Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/auth token middleware #16

Merged
merged 2 commits into from
Apr 9, 2024
Merged

Feat/auth token middleware #16

merged 2 commits into from
Apr 9, 2024

Conversation

random-logic
Copy link
Contributor

No description provided.

Copy link
Contributor

@Austin2Shih Austin2Shih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Very well commented too (better than my comments lol). Just check for jwt token expiration and we're good. If the verify function already does that then let me know and I'll just approve.

Good work 👍

* @param token - The token to be verified.
* @returns The response indicating the success or failure of token verification.
*/
export function verifyToken(token: Token): VerifyTokenResponse {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this check for token expiration? We probably want to check for that here or at least somewhere in the process.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does, jwt.verify should return the decoded token only if it's valid and not expired, otherwise it throws an error.

@Austin2Shih Austin2Shih merged commit 53a2164 into main Apr 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants